from tkinter import *
window = Tk()
window.title("这是第二个窗口界面")
window.geometry("700x500")

# pack() 以块的方式
# btn1 = Button(window,text="头部栏")
# btn1.pack(side="top",fill="x") # 设置头部并且填充x轴
# btn2 = Button(window,text="侧边栏")
# btn2.pack(side="left",fill="y") # 设置左边并且填充y轴
# btn3 = Button(window,text="内容体")
# btn3.pack(side="right",fill="both",expand="yes") # 启用可扩展空间


# grid() 以表格的形式
# btn1 = Button(window,text="1",bg="grey",fg="white",width=6)
# btn2 = Button(window,text="2",bg="grey",fg="white",width=6)
# btn3 = Button(window,text="3",bg="grey",fg="white",width=6)
# btn4 = Button(window,text="4",bg="grey",fg="white",width=6)
# btn5 = Button(window,text="5",bg="grey",fg="white",width=6)
# btn6 = Button(window,text="6",bg="grey",fg="white",width=6)
# btn1.grid(row=0,column=0)
# btn2.grid(row=0,column=1)
# btn3.grid(row=0,column=2)
# btn4.grid(row=1,column=0)
# btn5.grid(row=1,column=1)
# btn6.grid(row=1,column=2)

# place() 自由组合
# lb1 = Label(window,text="用户名：")
# lb2 = Label(window,text="密码：")
# en1 = Entry(window)
# en2 = Entry(window)
# lb1.place(x=10,y=5)
# lb2.place(x=10,y=35)
# en1.place(x=80,y=5)
# en2.place(x=80,y=35)
# btn = Button(window,text="登录",width=8)
# btn.place(x=120,y=70)


# Frame() 子窗口 盒子在大盒子里面组件小盒子
fm = Frame(window,width=300,height=200,bg="pink")
fm.place(x=100,y=100)
lb1 = Label(fm,text="用户名：")
lb2 = Label(fm,text="密码：")
en1 = Entry(fm)
en2 = Entry(fm)
lb1.place(x=10,y=5)
lb2.place(x=10,y=35)
en1.place(x=80,y=5)
en2.place(x=80,y=35)
btn = Button(fm,text="登录",width=8)
btn.place(x=120,y=70)


window.mainloop()